import time


def prime():
    for i in range(2, 400001):
        flag = True
        for j in range(2, i//2+1):
            if i % j == 0:
                flag = False
                break
        if flag:
            count.append(i)


if __name__ == "__main__":
    start = time.time()
    count = []
    prime()
    print("1-%r之间有%r个素数" % (400000, len(count)))
    timer = time.time() - start
    print("程序执行时间: %r 秒" % timer)
